﻿Imports System.Drawing.Printing

Public Class Form1

    Private Sub QRibbonPage1_Activated(ByVal sender As System.Object, ByVal e As System.EventArgs)

    End Sub

    Private Sub QRibbon1_ItemActivated(ByVal sender As System.Object, ByVal e As Qios.DevSuite.Components.QCompositeEventArgs) Handles QRibbon1.ItemActivated

    End Sub

    Private Sub QRibbonItem1_ItemActivated(ByVal sender As System.Object, ByVal e As Qios.DevSuite.Components.QCompositeEventArgs) Handles QRibbonItem1.ItemActivated
        RichTextBox1.Paste()
    End Sub

    Private Sub QRibbonItem2_ItemActivated(ByVal sender As System.Object, ByVal e As Qios.DevSuite.Components.QCompositeEventArgs) Handles QRibbonItem2.ItemActivated
        RichTextBox1.Copy()
    End Sub

    Private Sub QRibbonItem3_ItemActivated(ByVal sender As System.Object, ByVal e As Qios.DevSuite.Components.QCompositeEventArgs) Handles QRibbonItem3.ItemActivated
        RichTextBox1.Cut()
    End Sub

    Private Sub QRibbonItem4_ItemActivated(ByVal sender As System.Object, ByVal e As Qios.DevSuite.Components.QCompositeEventArgs) Handles QRibbonItem4.ItemActivated

        Dim SaveFile As New SaveFileDialog
        SaveFile.FileName = ""
        SaveFile.Filter = "Text Files (*.txt)|*.txt"
        SaveFile.Title = "Save"
        SaveFile.ShowDialog()
        Try
            Dim SWrite As New System.IO.StreamWriter(SaveFile.FileName)
            SWrite.Write(RichTextBox1.Text)
            SWrite.Close()
        Catch ex As Exception

        End Try

    End Sub

    Private Sub QRibbonItem5_ItemActivated(ByVal sender As System.Object, ByVal e As Qios.DevSuite.Components.QCompositeEventArgs) Handles QRibbonItem5.ItemActivated

    End Sub

    Private Sub QRibbonItem6_ItemActivated(ByVal sender As System.Object, ByVal e As Qios.DevSuite.Components.QCompositeEventArgs) Handles QRibbonItem6.ItemActivated
        Dim OpenFile As New OpenFileDialog
        OpenFile.FileName = ""
        OpenFile.Filter = "Text Files (*.txt)|*.txt"
        OpenFile.Title = "Open"
        OpenFile.ShowDialog()
        Try
            Dim Read As New System.IO.StreamReader(OpenFile.FileName)
            RichTextBox1.Text = Read.ReadToEnd
            Read.Close()
        Catch ex As Exception
        End Try
    End Sub

    Private Sub QRibbonItem7_ItemActivated(ByVal sender As System.Object, ByVal e As Qios.DevSuite.Components.QCompositeEventArgs) Handles QRibbonItem7.ItemActivated
        Dim Font As New FontDialog
        Font.ShowDialog()
        RichTextBox1.Font = Font.Font
    End Sub

    Private Sub QRibbonCaption1_ItemActivated(ByVal sender As System.Object, ByVal e As Qios.DevSuite.Components.QCompositeEventArgs) Handles QRibbonCaption1.ItemActivated

    End Sub

    Private Sub QButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles QButton1.Click
        RichTextBox1.Undo()
    End Sub

    Private Sub QButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles QButton2.Click
        RichTextBox1.Redo()
    End Sub

    Private Sub QRibbonPage1_Activated_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles QRibbonPage1.Activated

    End Sub

    Private Sub QRibbonItem8_ItemActivated(ByVal sender As System.Object, ByVal e As Qios.DevSuite.Components.QCompositeEventArgs)

    End Sub

    Private Sub QRibbonItem9_ItemActivated(ByVal sender As System.Object, ByVal e As Qios.DevSuite.Components.QCompositeEventArgs) Handles QRibbonItem9.ItemActivated
        ColorDialog1.ShowDialog()
        RichTextBox1.BackColor = ColorDialog1.Color
    End Sub

    Private Sub RichTextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RichTextBox1.TextChanged

    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Timer1.Start()
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

    End Sub

    Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Form2.Show()
    End Sub

    Private Sub QRibbonPanel6_ItemActivated(ByVal sender As System.Object, ByVal e As Qios.DevSuite.Components.QCompositeEventArgs)

    End Sub

    Private Sub QRibbonPage2_Activated(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles QRibbonPage2.Activated

    End Sub

    Private Sub QRibbonItem13_ItemActivated(ByVal sender As System.Object, ByVal e As Qios.DevSuite.Components.QCompositeEventArgs) Handles QRibbonItem13.ItemActivated
        Dim font As New FontDialog
        Font.ShowDialog()
        RichTextBox1.Font = Font.Font
    End Sub

    Private Sub QRibbonItem14_ItemActivated(ByVal sender As System.Object, ByVal e As Qios.DevSuite.Components.QCompositeEventArgs) Handles QRibbonItem14.ItemActivated
        ColorDialog1.ShowDialog()
        RichTextBox1.BackColor = ColorDialog1.Color
    End Sub

    Private Sub QRibbonItem15_ItemActivated(ByVal sender As System.Object, ByVal e As Qios.DevSuite.Components.QCompositeEventArgs)


    End Sub

    Private Sub QRibbonPanel9_ItemActivated(ByVal sender As System.Object, ByVal e As Qios.DevSuite.Components.QCompositeEventArgs)

    End Sub

    Private Sub QRibbonItem15_ItemActivated_1(ByVal sender As System.Object, ByVal e As Qios.DevSuite.Components.QCompositeEventArgs) Handles QRibbonItem15.ItemActivated
        If PrintDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
            PrintDocument1.Print()
        End If

    End Sub



    Private Sub QRibbonPage3_Activated(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles QRibbonPage3.Activated

    End Sub

    Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
        e.Graphics.DrawString(RichTextBox1.Text, RichTextBox1.Font, Brushes.Black, 100, 100)
    End Sub

    Private Sub QRibbonPage4_Activated(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles QRibbonPage4.Activated

    End Sub

    Private Sub QRibbonItem16_ItemActivated(ByVal sender As System.Object, ByVal e As Qios.DevSuite.Components.QCompositeEventArgs)
        Form2.Show()
    End Sub

    Private Sub QRibbonItem18_ItemActivated(ByVal sender As System.Object, ByVal e As Qios.DevSuite.Components.QCompositeEventArgs)

    End Sub

    Private Sub QRibbonItem1111_ItemActivated(ByVal sender As System.Object, ByVal e As Qios.DevSuite.Components.QCompositeEventArgs) Handles QRibbonItem1111.ItemActivated
        AboutBox1.Show()
    End Sub

    Private Sub QRibbonItem19_ItemActivated(ByVal sender As System.Object, ByVal e As Qios.DevSuite.Components.QCompositeEventArgs) Handles QRibbonItem19.ItemActivated
        Form2.Show()
    End Sub
End Class
